# encoding=utf8
import sys
reload(sys)
sys.setdefaultencoding('utf8')

class FT_8105:
    result=[]
    analysisDescription=['自定义消息体长度：','命令字：','命令参数：']
    analysis8105Length=[2,1,0]

    def LogicAisle(self, protocolStr, header):
        s=protocolStr[0:self.analysis8105Length[0]*2]
        header.append(self.analysisDescription[0]+s+'\n')
        s=protocolStr[self.analysis8105Length[0]*2:(self.analysis8105Length[0]+self.analysis8105Length[1])*2]
        if s=="81":
            msg=" 终端恢复原有模式"
        elif s=="82":
            msg=" 终端进入调试模式"
        else:
            msg=""
        header.append(self.analysisDescription[1]+s+msg+"\n")
        s=protocolStr[6:-4].decode("hex").decode('gb2312')
        header.append(self.analysisDescription[2]+s+'\n')
        self.result=header

